#ifndef __PT100_TEMP_H__
#define __PT100_TEMP_H__

#define SYSTEM_SUPPORT_OS        1        //定义系统文件夹是否支持OS
#if SYSTEM_SUPPORT_OS
#include "FreeRTOS.h"
#include "task.h"
#include "timers.h"
#include "queue.h"
#include "event_groups.h"
#include "semphr.h"
#endif

#include "stm32f10x.h"
#include "stm32f10x_it.h" 
#include <stdbool.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>

#include "delay.h"
#include "sys.h"
#include "usart.h"

#define PT100_TEMP_EN       0        //启动扩展芯片 

#define PT100Num            4        //pt100数量


void PT100_Data_Init(void);
void PT100_temp_event(uint16_t * Value);
void PT100_Alram_Level_event(void);

typedef union 
{
    uint8_t  Byte;
    struct
    {
      uint8_t  bit1:1;
      uint8_t  bit2:1;
      uint8_t  bit3:1;
      uint8_t  bit4:1;

      uint8_t  bit5:1;
      uint8_t  bit6:1;
      uint8_t  bit7:1;
      uint8_t  bit8:1;
    }bit;
}alarm_byte_t; 

typedef struct 
{
    int16_t General;     //告警阈值 一般告警
    int16_t Great;       //告警阈值 重大告警
    int16_t Urgent;      //告警阈值 紧急告警

}Temp_threshold_type;

typedef struct 
{
    //0:正常  1：一般  2：重大  3：紧急
    uint8_t Level;                   //告警级别
    int16_t TempValue;               //采集到的温度
    Temp_threshold_type *threshold;  //告警阈值
}PT100_Data_type;

extern Temp_threshold_type   tempThreshold[] ;
extern PT100_Data_type       Pt100Data[] ;

#endif
